Response
public class Response
| Constructor Summary | |
|---|---|
| void | __construct(mixed data, int code, array header, array options) 架构函数 |
| Method Summary | |
|---|---|
| static Response|JsonResponse|ViewResponse|XmlResponse|RedirectResponse|JsonpResponse | create(mixed data, string type, int code, array header, array options) 创建Response对象 |
| static mixed | send() 发送数据到客户端 |
| protected mixed | output(mixed data) 处理数据 |
| $this | options(mixed options) 输出的参数 |
| $this | data(mixed data) 输出数据设置 |
| $this | header(string|array name, string value) 设置响应头 |
| $this | content($content content) 设置页面输出内容 |
| $this | code(integer code) 发送HTTP状态 |
| $this | lastModified(string time) LastModified |
| $this | expires(string time) Expires |
| $this | eTag(string eTag) ETag |
| $this | cacheControl(string cache) 页面缓存控制 |
| $this | contentType(string contentType, string charset) 页面输出类型 |
| mixed | getHeader(string name) 获取头部信息 |
| mixed | getData() 获取原始数据 |
| mixed | 获取输出数据 |
| integer | getCode() 获取状态码 |
public void __construct(mixed data, int code, array header, array options)
架构函数
public static Response|JsonResponse|ViewResponse|XmlResponse|RedirectResponse|JsonpResponse create(mixed data, string type, int code, array header, array options)
创建Response对象
public static mixed send()
发送数据到客户端
protected mixed output(mixed data)
处理数据
public $this options(mixed options)
输出的参数
public $this data(mixed data)
输出数据设置
public $this header(string|array name, string value)
设置响应头
public $this content($content content)
设置页面输出内容
public $this code(integer code)
发送HTTP状态
public $this lastModified(string time)
LastModified
public $this expires(string time)
Expires
public $this eTag(string eTag)
ETag
public $this cacheControl(string cache)
页面缓存控制
public $this contentType(string contentType, string charset)
页面输出类型
public mixed getHeader(string name)
获取头部信息
public mixed getData()
获取原始数据
public mixed getContent()
获取输出数据
public integer getCode()
获取状态码